<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title></title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
		<script type="text/javascript">
		<!--
			var ligerTable = null;
			$(function(){
				$('.select-chosen').chosen();
				$('.date-picker').datepicker();
				ligerTable = $('#table').ligerGrid({
					width:'98%',
					enabledSort:false,
					pageSizeOptions:[5,10,20,50,100,200],
					height:'auto',
					alternatingRow:true,
					url:'${base}/${route}/getList',
					delayLoad:false,
					columns:[
						{display:'行程单号',name:'taskNo',id:'taskNo',align:'center',minWidth:150},
						{display:'退款金额',name:'refundFee',id:'refundFee',align:'center',minWidth:80},
						{
							display:'退款状态',
							name:'refundStatus',
							id:'refundStatus',
							align:'center',
							minWidth:150,
							render:function(row){
								var refundStatus = row.refundStatus;
								if(refundStatus == 1){
									return '申请退款';
								}
								else if(refundStatus == 2){
									return '退款成功';
								}
								else if(refundStatus == 4){
									return '退款失败';
								}
							}
						},
						{
							display:'支付方式',
							name:'taskPayId',
							id:'taskPayId',
							align:'center',
							minWidth:150,
							render:function(row){
								var taskPayId = row.taskPayId;
								if(taskPayId == 1){
									return '支付宝';
								}
								else if(taskPayId == 2){
									return '微信';
								}
								else if(taskPayId == 3){
								    /* ycs 180912
									return '余额';
									*/
                                    return '余额(已作废)';
								} else {
                                    return '微信';
								}
							}
						},
						{
							display:'退款时间',
							name:'refundTime',
							id:'refundTime',
							align:'center',
							minWidth:150,
							render:function(row){
								var refundTime = row.refundTime;
								if(refundTime > 0){
									return formatDate(refundTime * 1000);
								}
								return '-';
							}
						},
						{display:'支付订单号',name:'taskPayTradeNo',id:'taskPayTradeNo',align:'center',minWidth:150},
						{display:'备注',name:'remark',id:'remark',align:'center',minWidth:150}
					]
				});
				
				function reload(){
					if(ligerTable){
						var refundStatus = $('#refundStatus').val();
						var startTime = $('#txtStartTime').val();
						var endTime = $('#txtEndTime').val();
						var searchKey = $('#txtSearchKey').val();
						ligerTable.setParm('refundStatus',refundStatus);
						ligerTable.setParm('startTime',startTime);
						ligerTable.setParm('endTime',endTime);
						ligerTable.setParm('searchKey',searchKey);
						ligerTable.reload();
					}
				}
				$('#btnSearch').click(function(){
					reload();
				})
			});
		//-->
		</script>
	</head>
	<body class="$configs["skinName"]">
		<#include "common/breadcrumb.ftl">
		<div class="widget-box">
			<div class="widget-header widget-header-flat">
				<h5 class="lighter">
					<i class="fa fa-search"></i>
					${module}查询
				</h5>
			</div>
			<div class="widget-body">
				<div class="widget-main">
					<div class="row">
						<div class="input-daterange input-group col-sm-10">
							<span class="input-group-addon">时间段</span>
							<input class="form-control date-picker" id="txtStartTime" type="text" value="${startTime}" data-date-format="yyyy-mm-dd" />
							<span class="input-group-addon">
								<i class="fa fa-calendar"></i>
							</span>
							<span class="input-group-addon">
								<i class="fa fa-exchange"></i>
							</span>
							<input class="form-control date-picker" id="txtEndTime" type="text" value="${endTime}" data-date-format="yyyy-mm-dd" />
							<span class="input-group-addon">
								<i class="fa fa-calendar"></i>
							</span>
						</div>
					</div>
					<div class="space-4"></div>
					<div class="row">
						<div class="col-sm-2 input-group">
							<span class="input-group-addon">退款状态</span>
							<select id="refundStatus">
								<option value="0">全部</option>
								<option value="1">申请退款</option>
								<option value="2">退款成功</option>
								<option value="4">退款失败</option>
							</select>
						</div>
						<div class="col-sm-6">
							<div class="input-group">
								<span class="input-group-addon">关键字</span>
								<input id="txtSearchKey" type="text" class="form-control search-query" placeholder="请输关键字搜索" />
								<span class="input-group-btn">
									<button id="btnSearch" type="button" class="btn btn-purple btn-sm">
										查询
										<i class="icon-search icon-on-right bigger-110"></i>
									</button>
								</span>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="widget-box">
			<div class="widget-header">
				<h5 class="lighter">
					<i class="icon-table"></i>
					${module}列表
				</h5>
			</div>
			<div class="widget-body">
				<div id="table"><div>
			</div>
		</div>
	</body>
</html>